package edu.whut.regexTest;
/*
1.qq正则
    不能以0开头，全是数字，5-12位
2.手机号正则
    1开头，第二位3 4 5 6 7 8 9，全数字，必须11位
3.邮箱正则
    zhangsan@qq.com
 */
public class RegexTest01 {
    public static void main(String[] args) {
        String qqregex = "[1-9]\\d{4,11}";
        System.out.println("2970489332".matches(qqregex));

        String phoneregex = "[1][3-9]\\d{9}";
        System.out.println("18736290143".matches(phoneregex));
        System.out.println("----------------------");

        String emileregex = "\\w+[@][\\w&&[^_]]+(\\.[a-z]{2,3})+";
        System.out.println("zhangs@163.com.cn".matches(emileregex));
        System.out.println("zhangsan@qq.com".matches(emileregex));
        System.out.println("zhangsan@163.com".matches(emileregex));
        System.out.println("zhang@qq.com.cn".matches(emileregex));
    }
}
